package main

import (
	"encoding/json"
	"fmt"
)

func main() {

	personSalary := map[string]int{
		"Steven": 18000,
		"Daniel": 5000,
		"Josh":   20000,
	}
	fmt.Println("原始薪资：", personSalary)
	newPersonSalary := personSalary
	newPersonSalary["Daniel"] = 8000
	fmt.Println("修改后newPersonSalary: ", newPersonSalary)
	fmt.Println("personSalary受影响情况: ", personSalary)

	//go func() {
	//	fmt.Println("begin")
	//	time.Sleep(time.Duration(2)*time.Second)
	//	fmt.Println("end")
	//}()
	//fmt.Println("main over")
	//time.Sleep(time.Duration(3)*time.Second)

	a := make([]int32, 2)
	a = append(a, 3)

	var b = map[string]string{}
	fmt.Println(len(b))
	fmt.Println(b["a"])

	jsonStr := `{"spreadurl":"testxx6","spreadname":"test-6","channel":"test-channel","clicktime":1588812509225,"ua":"tTiyvImJlDioQqkFUvHIUzxd00MJIlwUhAPxwjY2CMetrD9M6u6ZXt9","uip":"82.227.141.145","appkey":"test_app_key","activetime":1588820078225,"osversion":"RCUkf7P","devicetype":"F0QHoM","idfa":"","mac":"FH3DSkBCTqPCydw3jTuQjzOCPLfXSZmZFT99hILVpqjH3vsF","androidid":"gn4djVdbQcwyixQgvvnrRCCRby0bIBPp","imei":"oz99jgn5zAykGKO3GFeBbkc1AqhngYpl","aip":"82.227.141.145","skey":"7A1F3A0F42D08642BDC5F0047CEF6558","account":"FIC0X2OkbIfa72"}`
	var jsonObject map[string]interface{}
	json.Unmarshal([]byte(jsonStr), &jsonObject)
	fmt.Println(jsonObject["appkey"])
}
